import request from '@/utils/request'

export function getUserList(params) {
  return request({
    url: '/user/list',
    method: 'get',
    params: params
  })
}

export function addUser(data) {
  return request({
    url: '/user/',
    method: 'post',
    data
  })
}

export function getUserDetail(params) {
  return request({
    url: '/user/'+params,
    method: 'get'
  })
}

export function getUserRole(params) {
  return request({
    url: '/user/roles/'+params,
    method: 'get'
  })
}

export function updateUser(data) {
  return request({
    url: '/user/',
    method: 'put',
    data
  })
}

export function updateUserRole(data) {
  return request({
    url: '/user/editRole',
    method: 'put',
    data
  })
}

export function deleteUser(params) {
  return request({
    url: '/user/'+params,
    method: 'delete'
  })
}

export function getRoleList(params) {
  return request({
    url: '/role/list',
    method: 'get',
    params: params
  })
}

export function addRole(data) {
  return request({
    url: '/role/',
    method: 'post',
    data
  })
}

export function getRoleDetail(params) {
  return request({
    url: '/role/'+params,
    method: 'get'
  })
}

export function updateRole(data) {
  return request({
    url: '/role/',
    method: 'put',
    data
  })
}

export function deleteRole(params) {
  return request({
    url: '/role/'+params,
    method: 'delete'
  })
}

export function getSettingList(params) {
  return request({
    url: '/systemconfig/list',
    method: 'get',
    params: params
  })
}

export function addSetting(data) {
  return request({
    url: '/systemconfig/',
    method: 'post',
    data
  })
}

export function getSettingDetail(params) {
  return request({
    url: '/systemconfig/'+params,
    method: 'get'
  })
}

export function updateSetting(data) {
  return request({
    url: '/systemconfig/',
    method: 'put',
    data
  })
}

export function deleteSetting(params) {
  return request({
    url: '/systemconfig/'+params,
    method: 'delete'
  })
}